def dz(n):
    s = 0
    for i in range(1, n):
        if n % i == 0:
            s += i

    return s


def check(n):
    if n == dz(n):
        return True
    else:
        return False


def main():
    for i in range(1, 1000+1):
        if check(i):
            print(i, end='')
            print(" its factors are 1", end='')
            for j in range(2, i):
                if i % j == 0:
                    print(','+str(j), end='')

            print()


print(check(512*1023))

if __name__ == '__main__':
    main()
